package se392.ateam2006.meetingmgmt;

import java.util.Collection;
import java.util.GregorianCalendar;
import javax.ejb.CreateException;
import javax.ejb.Local;

import se392.ateam2006.meetingmgmt.meeting.Duration;
import se392.ateam2006.meetingmgmt.meeting.MeetingEntity;
import se392.ateam2006.resourcemgmt.room.RoomEntity;
import se392.ateam2006.user.UserEntity;

/**
 * Local interface for the MeetingMgmtBean - allows access inside the local JVM
 * @author Ateam (Matthew Bennett, Claire Melton, Shingai Manyiwa, John Adderley)
 * @version 25/03/07
 */
@Local
public interface MeetingMgmtLocal {
    
    Duration createDuration(int days, int hours, int mins) throws CreateException;

    void createMeeting(UserEntity initiator, String id, String title, String description,
                    GregorianCalendar startDateRange, GregorianCalendar endDateRange,
                    Duration duration, int requestedRoomSize, String equipment, RoomEntity room) throws CreateException;

    void deleteMeeting(MeetingEntity me);

    void deleteMeetingById(String id);

    Duration findDurationByID(long id);

    MeetingEntity findMeetingById(String id);

    Collection<MeetingEntity> findMeetings(String userId);

    Collection findMeetingsByInitiator(UserEntity user);

    Collection getAllMeetings();

    Collection getBookedMeetings();

    int getMeetingCount();

    void removeAllEquipment();

    void removeAllMeetings();

    void setMeetingAsBooked(String meetingId, boolean booked);

    /**
     * Retrieves value that MeetingEntity should use as default cutoff period 
     * 
     * @return the current default cutoff period
     */
    int getDefaultCutOffPeriod();

    /**
     * Sets the value that Meetings should default to as response cutoff
     * 
     * @param aDefaultCutOffPeriod - int, the new cutoff period
     */
    void setDefaultCutOffPeriod(int aDefaultCutOffPeriod);
}
